{include file="public/layout" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 管理员管理 
	<span class="c-gray en">&gt;</span> 管理员日记 
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray"> <span class="l"> <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a></span> <span class="r">共有数据：<strong>{$count}</strong> 条</span> </div>
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="25"><input type="checkbox" id="checkAll"></th>
				<th width="80">ID</th>
				<th width="100">角色名称</th>
				<th width="40">描述</th>
				<th width="90">IP</th>
				<th width="150">操作时间</th>
			</tr>
		</thead>
		<tbody>
			{foreach name="list" item="vo" key="k" }
			<tr class="text-c">
				<td><input type="checkbox" value="{$vo.log_id}" class="checkboxId"></td>
				<td>{$vo.log_id}</td>
				<td>{$vo.user_name}</td>
				<td>{$vo.log_info}</td>
				<td>{$vo.log_ip}</td>
				<td>{$vo.log_time|date="Y-m-d H:i:s"}</td>
			</tr>
		    {/foreach}
		</tbody>
	</table>
	<div>{$list->render()|raw}</div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
	//批量删除
	function datadel() {
		var ids = '';
		var len = $(".checkboxId").length;
		for(var i = 0; i < len; i++) {
			var status = $(".checkboxId").eq(i).prop("checked");
			if(status == true) {
				var checkval = 1;
				ids+= ','+$(".checkboxId").eq(i).val();
			}
		}

		//至少选择一项目
		if(checkval == 1) {
			var ids = ids.substring(1);
			layer.confirm('确认要删除吗？',function(index){
				$.ajax({
						type: 'POST',
						url: '/Admin/Admin/delAllLog',
						data : {act:'delAll',ids:ids},
						dataType: 'json',
						success: function(data){
							layer.msg('已删除!',{icon:1,time:1000});
							setTimeout(function(){window.location.reload();}, 2000);
						},
						error:function(data) {
							console.log(data.msg);
						},
				});		
			});
		} else {
			layer.msg('至少选择一项目!',{icon:2,time:1000});
		}
	}
</script>
</body>
</html>